{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<script type="text/javascript" src="__TMPL__Common/js/calendar/calendar.php?lang=zh-cn" ></script>
<load href='__TMPL__Common/js/calendar/calendar.css' />
<load href='__TMPL__Common/js/calendar/calendar.js' />
<PHP>
	function get_handle($id)
	{
		$order_info = M("TakeawayOrder")->getById($id);
		if($order_info['status']==0)
		{
			$str = l("DEAL_ORDER_HANDLE");
		}
		else
		{
			$str = l("DEAL_ORDER_VIEW");
		}
		$str = "<a href='".u("TakeawayOrder/view_order",array("id"=>$id))."'>".$str."</a>";
		return $str;
	}
	
</php>
<load href='__TMPL__Common/js/jquery.bgiframe.js' />
<load href='__TMPL__Common/js/jquery.weebox.js' />
<load href='__TMPL__Common/style/weebox.css' />

<div class="main">
<div class="main_title">{%DEAL_ORDER}</div>
<div class="blank5"></div>
<form name="search" action="__APP__" method="get">	
<div class="button_row">
	<input type="button" class="button" value="{%DEL}" onclick="del();" />
	<input type="submit" class="button" value="{%SEARCH}" />
	<if condition="!$_REQUEST['referer']">
	<input type="button" class="button" value="{%EXPORT}" onclick="export_csv();" />
	</if>
	
</div>
<div class="blank5"></div>
<div class="search_row">
		餐厅ID：<input type="text" class="textbox" name="supplier_location_id" value="{:trim($_REQUEST['supplier_location_id'])}" style="width:80px;" />
		下单时间：<input type="text" name="begindate" id="uc_ct_begin_date" class="textbox" size="8" value="{:trim($_REQUEST['begindate'])}" onfocus="this.blur(); return showCalendar('uc_ct_begin_date', '%Y-%m-%d', false, false, 'uc_ct_begin_date');" >
		至
		<input type="text" name="enddate" id="uc_ct_end_date" class="textbox" size="8" value="{:trim($_REQUEST['enddate'])}" onfocus="this.blur(); return showCalendar('uc_ct_end_date', '%Y-%m-%d', false, false, 'uc_ct_end_date');" >
		
		{%ORDER_SN}：<input type="text" class="textbox" name="order_sn" value="{:trim($_REQUEST['order_sn'])}" style="width:100px;" />
		
		订单状态: 
		<select name="status">
				<option value="-1" <if condition="$_REQUEST['status'] eq '-1'">selected="selected"</if>>{%ALL}</option>
				<option value="0" <if condition="$_REQUEST['status'] eq '0'">selected="selected"</if>>{%STORE_ORDER_STATUS_0}</option>
				<option value="1" <if condition="$_REQUEST['status'] eq '1'">selected="selected"</if>>下单成功</option>
				<option value="2" <if condition="$_REQUEST['status'] eq '2'">selected="selected"</if>>下单失败</option>	
		</select>		
		<input type="hidden" value="TakeawayOrder" name="m" />
		<input type="hidden" value="index" name="a" />
</div>
</form>
<div class="blank5"></div>
<html:list 
	id="dataTable" 
	style="dataTable" 
	name="deal_order" 
	checkbox="true" 
	action="true" 
	datasource="list" 
	show="id:{%ID}|50px,order_sn:{%ORDER_SN},supplier_location_id|get_location_name:商户,create_time|to_date:{%ORDER_CREATE_TIME},contacter:联系人,tel:联系电话,status|get_order_status=$deal_order['status']:订单状态,cache_data|get_total_price=$deal_order['status']:消费" 
	actionlist="id|get_handle" /> 

<div class="blank5"></div>
<div class="page">{$page}</div>
</div>
<include file="Public:footer" />